﻿Imports System.Data
Imports VSModel
Imports Cls_Common
Imports SecurityService
Partial Class FrontEnd_Control_Footer
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Dim lstNode As New DataSet
            lstNode.ReadXml(MapPath("../../xml/Footer.xml"))
            With rptMenu
                .DataSource = lstNode.Tables("Node")
                .DataBind()
            End With
            Using _data As New VSEntities

                Dim p = (From q In _data.Menus Where q.TitlePage = "footer" Select q).FirstOrDefault
                If Not p Is Nothing Then
                    ltrFooter.Text = p.Description
                End If

            End Using
        End If
    End Sub

    Protected Sub rptMenu_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptMenu.ItemDataBound
        Dim hplTitle As HyperLink = CType(e.Item.FindControl("hplTitle"), HyperLink)
        hplTitle.NavigateUrl = MainDomain & e.Item.DataItem("URL").ToString
        hplTitle.Text = e.Item.DataItem("Title")
    End Sub
End Class
